C++11 结构初始化


    struct StudentInfo
    {
        char name[20];
        int age;
    };

    int main()
    {
        using namespace std;
        StudentInfo shenjun = {
            "shenjun",
            40
        };

        cout << shenjun.name << "," << shenjun.age << endl;
        return 0;
    }